//
//  SyncManager.m
//  MilkyWayReader
//
//  Created by Quoc Dung Chu on 31/03/12.
//  Copyright (c) 2012 Paris 6. All rights reserved.
//

#import "SyncManager.h"
#import "MKWAsyncTask.h"
#import "MKWPool.h"
static SyncManager * s_sharedManager;
@interface SyncManager  ()
@property (nonatomic, strong) MKWPool * pool;
@end

@implementation SyncManager
@synthesize pool;
+ (SyncManager *) sharedManager
{
    if (s_sharedManager == nil)
    {
        s_sharedManager = [SyncManager new];
    }
    return s_sharedManager;
}

- (MKWPool *) pool
{
    if (!pool) {
        pool = [MKWPool new];
    }
    return  pool;
}


- (void) sync
{

    [self.pool performInAsyncTaskDoBeginAction:^{
        NSLog(@"%@",[NSThread currentThread]);
    } doInBackgroundAction:^{
        NSLog(@"%@",[NSThread currentThread]);
    } doProgressAction:^(int progress) {
        
    } doFinishAction:^{
        NSLog(@"%@",[NSThread currentThread]);
    }];
}

@end
